package tests;

import static org.junit.Assert.*;
import mt.Order;
import mt.comm.ClientSideMessage;
import mt.dummy.Message;

import org.junit.Test;

public class MessageTest {

	@Test
	public void testMessage() {
		new Message(null, null);
	}

	@Test
	public void testGetType() {
		Message x = new Message(null, null);
		assertNull(x.getType());
	
		Message x1 = new Message(ClientSideMessage.Type.ORDER, Order.createBuyOrder("nickname", "stock", 2, 2.0));
		assertNotNull(x1.getType());
	}

	@Test
	public void testGetOrder() {
		Message x = new Message(null, null);
		assertNull(x.getOrder());
	
		Message x1 = new Message(ClientSideMessage.Type.ORDER, Order.createBuyOrder("nickname", "stock", 2, 2.0));
		assertNotNull(x1.getOrder());
	}

	@Test
	public void testGetError() {
		Message x = new Message(null, null);
		assertNotNull(x.getError());
	}

}
